<?php

namespace App\Http\Controllers\Admin\System;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Cache;

class CacheController extends Controller
{
    function __construct()
    {
        view()->share([
            '_cache' => 'am-active',
            '_system' => 'am-in'
        ]);
    }

    /***
     * 清除缓存首页
     */
    public function index()
    {
        return view('admin.system.cache.index');
    }

    /***
     * 清除缓存
     */
    public function destroy()
    {
        Cache::flush();
        return back()->with('success', '清除缓存成功');
    }
}
